
	<form id="formEdit">
            <div class="modal-body"> 
            	<!-- 以下为要修改的的内容 -->
				<input type="hidden" name="id" data-th-value="${model.id}">
                <div class="form-group">
                	<label for="txt_courseId">课程名</label>
                    <select id="text_courseId" name="courseId" class="form-control">
                    	<option data-th-each="course:${courses}" data-th-value="${course.id}" data-th-text="${course.name}" data-th-selected="${model.course!=null&&course.id==model.course.id}">课程名</option>
                    </select>
                </div>
                <div class="form-group">
                	<label for="txt_title">标题</label>
                	<input type="text" class="form-control" name="title" id="txt_title" data-th-value="${model.title}" placeholder="标题">
                </div>
                <div class="form-group">
                	<label for="txt_demo">内容</label>
                    <textarea rows="10" id="txt_demo" name="demo" class="summernote form-control" data-th-utext="${model.demo}"></textarea>
                </div>
                
				<div class="checkbox">
					<label><input type="checkbox" name="onTop"  data-th-checked="${model.onTop}" value="true"> <span class="glyphicon glyphicon-bookmark" title="置顶"
								data-toggle="tooltip" data-placement="right"></span>置顶 </label>
				</div>
				
                
                <!-- 以上为要修改的内容 -->
            </div>
            <div class="modal-footer">
                <button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span>保存</button>
                <button type="button" class="btn btn-default" onclick="close1()"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span>关闭</button>
            </div>
	</form>
<script type="text/javascript" th:inline="javascript">
    $(function () {
        $('.summernote').summernote({
        	height: 350,
        	lang: 'zh-CN'
      	}); 

 		var options= {
			message: '验证不通过',
			feedbackIcons: {
              valid: 'glyphicon glyphicon-ok',
              invalid: 'glyphicon glyphicon-remove',
              validating: 'glyphicon glyphicon-refresh'
          	},
          	fields:  {
				title: {
					validators: {
						notEmpty: {
							message: '标题不能为空'
						}
					}
				}
			}
 		};
        $('#formEdit').bootstrapValidator(options).on('success.form.bv', function(e) {
        	e.preventDefault();	//很重要没有它则会提交默认表单，不会做下面的ajax表单提交
            var fd = new FormData($("#formEdit")[0]);
            $.ajax({  
              url: "save",  
              type: "POST",  
              data: fd,  
              processData: false,  // 不处理数据  
              contentType: false,   // 不设置内容类型
              success:function(data){
            	  if(data.success){
            			$('#experence_table_div').find('table').bootstrapTable('refresh');
            			close1();
            	  }else{
            		  bootbox.alert(data.msg);
            	  }
              }
            });  
        });
    });
    function close1(){
		var that=$('#experence_table_div');
		var self=$('#edit');
		self.hide();
		that.show();
    }
</script>
	
